package cn.fanyamin.servlet;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;


public class OnlineCountListener implements HttpSessionListener {
	private int count=0;
	public void sessionCreated(HttpSessionEvent se){
		count++;
		se.getSession().setAttribute("onlineCount",new Integer(count));
	}
	public void sessionDestroyed(HttpSessionEvent se){
		count--;
		se.getSession().setAttribute("onlineCount",new Integer(count));
	}
}
